package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CommonUserInfoMapper;
import com.ruoyi.system.domain.CommonUserInfo;
import com.ruoyi.system.service.ICommonUserInfoService;

/**
 * 普通用户详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-11
 */
@Service
public class CommonUserInfoServiceImpl implements ICommonUserInfoService 
{
    @Autowired
    private CommonUserInfoMapper commonUserInfoMapper;

    /**
     * 查询普通用户详情
     * 
     * @param userId 普通用户详情主键
     * @return 普通用户详情
     */
    @Override
    public CommonUserInfo selectCommonUserInfoByUserId(Long userId)
    {
        return commonUserInfoMapper.selectCommonUserInfoByUserId(userId);
    }

    /**
     * 查询普通用户详情列表
     * 
     * @param commonUserInfo 普通用户详情
     * @return 普通用户详情
     */
    @Override
    public List<CommonUserInfo> selectCommonUserInfoList(CommonUserInfo commonUserInfo)
    {
        return commonUserInfoMapper.selectCommonUserInfoList(commonUserInfo);
    }

    /**
     * 新增普通用户详情
     * 
     * @param commonUserInfo 普通用户详情
     * @return 结果
     */
    @Override
    public int insertCommonUserInfo(CommonUserInfo commonUserInfo)
    {
        commonUserInfo.setCreateTime(DateUtils.getNowDate());
        return commonUserInfoMapper.insertCommonUserInfo(commonUserInfo);
    }

    /**
     * 修改普通用户详情
     * 
     * @param commonUserInfo 普通用户详情
     * @return 结果
     */
    @Override
    public int updateCommonUserInfo(CommonUserInfo commonUserInfo)
    {
        return commonUserInfoMapper.updateCommonUserInfo(commonUserInfo);
    }

    /**
     * 批量删除普通用户详情
     * 
     * @param userIds 需要删除的普通用户详情主键
     * @return 结果
     */
    @Override
    public int deleteCommonUserInfoByUserIds(Long[] userIds)
    {
        return commonUserInfoMapper.deleteCommonUserInfoByUserIds(userIds);
    }

    /**
     * 删除普通用户详情信息
     * 
     * @param userId 普通用户详情主键
     * @return 结果
     */
    @Override
    public int deleteCommonUserInfoByUserId(Long userId)
    {
        return commonUserInfoMapper.deleteCommonUserInfoByUserId(userId);
    }
}
